package cn.com.ylpw.web.util;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import cn.com.ylpw.dao.ISuperDao;

import com.google.common.collect.Maps;

@Service("abstractService")
public abstract class AbstractService {
	@Autowired
	@Qualifier("myBatisService")
	protected ISuperDao superDao;
	
	/**
	 * 获得序列值
	 * 
	 * @author July july_sky@foxmail.com
	 * @date 2015年5月25日上午8:14:14
	 * @param seqName
	 * @return
	 * @throws Exception
	 */
	public Long getSequence(String seqName) throws Exception{
		Map<String,Object> params = Maps.newHashMap();
		params.put("sequenceName", seqName);
		return superDao.getMyBatisFactory().getObject("common", "getSequence", params);
	}
}
